package ru.dadle8.service.impl.command.content;

import org.springframework.stereotype.Service;
import org.telegram.telegrambots.meta.api.objects.Message;
import org.telegram.telegrambots.meta.api.objects.Update;
import org.telegram.telegrambots.meta.exceptions.TelegramApiException;
import ru.dadle8.model.bot.type.CommandState;
import ru.dadle8.service.impl.command.AbstractCommandService;

@Service
public class VideoContentReceiverServiceImpl extends AbstractCommandService {

    @Override
    public CommandState getCommandState() {
        return CommandState.CONTENT_RECEIVER;
    }

    @Override
    public void processUpdate(Update update) throws TelegramApiException {
        Message inMess = update.getMessage();
        Long chatId = inMess.getChatId();
        getBot().execute(getMessageHelper().sendMessage(chatId, inMess.getVideo().getFileId()));
    }
}
